var oldclass = "oldClass";
function Selection(id) {
if (oldclass != "oldClass") {
    var oldelement = ReturnElementById("Selection");
            oldelement[0].className = oldclass;
        }
        var elem = document.getElementById(id);
        oldclass = elem.className;
        var element = document.getElementById(id);
        element.className = "Selection";
    }
function ReturnElementById(cl) { 
      var retnode = []; 
      var myclass = new RegExp('\\b'+cl+'\\b');
      var elem = document.getElementsByTagName('tr');
      for (var i = 0; i < elem.length; i++) {
          var classes = elem[i].className; 
         if (myclass.test(classes)) { 
            retnode.push(elem[i]); 
         }
    } 
      return retnode; 
   } 